'use strict';

const moment = require('moment');
const Sequelize = require('sequelize');
const {Model} = Sequelize;

const mysql = require('../common/mysql');

class AccessToken extends Model {}

AccessToken.init({
    id: {
        type: Sequelize.INTEGER,
        primaryKey: true,
        autoIncrement: true
    },
    accessToken: {
        type: Sequelize.STRING,
    },
    refreshToken: {
        type: Sequelize.STRING,
    },
    userCode: {
        type: Sequelize.STRING,
    },
    expiresIn: {
        type: Sequelize.STRING,
    },
    createdAt: {
        type: Sequelize.STRING,
    }
}, {
    sequelize: mysql,
    modelName: 'accessToken',
    timestamps: false,
});

module.exports = AccessToken;